package com.leadnews.apis.article;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.leadnews.apis.article.fallback.IArticleClientFallback;
import com.leadnews.model.article.dtos.ArticleDto;
import com.leadnews.model.article.pojos.ApArticleConfig;
import com.leadnews.model.common.dtos.ResponseResult;
import com.leadnews.model.common.enums.AppHttpCodeEnum;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "leadnews-article-plus",fallback = IArticleClientFallback.class)
public interface IArticleClient {

    @PostMapping("/api/vi/article/save")
//    @SentinelResource(value = "saveArticle", blockHandler = "IArticleClientFallback")
     ResponseResult saveArticle(@RequestBody ArticleDto dto);

    @PostMapping("/api/vi/article/upOrDown")
    ResponseResult downOrUp(@RequestBody ApArticleConfig dto);


}

